package org.x.legalcasemod.controller;


import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.x.legalcasemod.service.ExcelService;

import java.io.IOException;

@RestController
public class ExcelController {

    @Autowired
    private ExcelService excelService;
    /**
     * 导出案件
     * @param response
     * @return
     */
    @GetMapping("/export")
    public void download(HttpServletResponse response,@RequestParam String case_no) throws IOException {
        excelService.exportCaseToBrowser(case_no, response);
    }

}
